package com.yiren.dbaa.module.practice_set.map.contract;

import com.yiren.backstage.currency.bean.GpsInfoBean;
import com.yiren.backstage.currency.bean.PointBean;
import com.yiren.backstage.currency.entity.TrajectoryEntity;
import com.yiren.backstage.currency.entity.TrajectoryPointEntity;
import com.yiren.dbaa.currency.model.MultiLaneModel;
import com.yiren.dbaa.view.TrajectoryMapView;

import java.util.HashMap;
import java.util.List;

/**
 * @author lwb
 * @date : 2022/6/1 10:32
 * @description: 采集契约类  管理
 */
public interface CollectContract {

    interface Presenter {
        /**
         * 轨迹新增
         *
         * @return
         */
        TrajectoryEntity saveTrajectory(int trajectoryType, boolean isAdd);

        /**
         * 更新轨迹
         *
         * @param trajectory
         * @return
         */
        boolean updateTrajectory(TrajectoryEntity trajectory);

        /**
         * 保存轨迹点位
         *
         * @param operCode 1:新增 2：修改
         */
        boolean saveTrajectoryPoint(TrajectoryPointEntity trajectoryPoint, int operCode);

        /**
         * 自动采集
         */
        PointBean autoCollectPoint(PointBean lastAutoCollectPoint, TrajectoryEntity currentTrajectory, TrajectoryMapView mapView);

        /**
         * 初始化轨迹点位集合
         */
        void initTrajectoryPoints(TrajectoryMapView mapView);

        /**
         * 删除轨迹
         *
         * @param trajectoryEntity
         * @return
         */
        boolean deleteTrajectory(TrajectoryEntity trajectoryEntity);

        /**
         * 校准点位
         */
        boolean calibrationTrajectoryPoint(TrajectoryPointEntity trajectoryPoint, GpsInfoBean gpsInfo);


        /**
         * 删除点位
         *
         * @param trajectoryPoint
         * @return
         */
        boolean deleteTrajectoryPoint(TrajectoryPointEntity trajectoryPoint);

        /**
         * 根据标定状态设置轨迹点位
         *
         * @return
         */
        PointBean setTrajectoryPoint(GpsInfoBean gpsInfo);


        /**
         * 设置多车道实体
         *
         * @param mapView
         * @return
         */
        MultiLaneModel setMultiLaneModel(TrajectoryMapView mapView, TrajectoryEntity trajectory, int position);

        /**
         * 多车道采集保存
         *
         * @param mapView
         */
        void multiLaneTrajectorySave(TrajectoryMapView mapView);

        /**
         * 保存双黄线左侧实线点位
         *
         * @param trajectoryPoints
         * @param pyDistance
         */
        void saveSHXLeftPoint(List<TrajectoryPointEntity> trajectoryPoints, float pyDistance);

        /**
         * 点位是否标定状态
         *
         * @return
         */
        boolean loadPointCalibrationStatus();

        /**
         * 加载附近轨迹
         *
         * @param currentPoint
         * @param isBaseCalibration
         * @return
         */
        HashMap<String, List<TrajectoryPointEntity>> loadTrajectory(PointBean currentPoint, boolean isBaseCalibration);


        /**
         * 加载距离x最近点
         *
         * @param x
         * @return
         */
        TrajectoryPointEntity loadMinTPoint(float x);

        /**
         * 加载距离longitude最近点
         *
         * @param longitude
         * @param flag
         * @return
         */
        TrajectoryPointEntity loadMinTPoint(double longitude, boolean flag);

    }

    interface Model {

        /**
         * 根据标定状态设置轨迹点位
         *
         * @return
         */
        PointBean setTrajectoryPoint(GpsInfoBean gpsInfo);

        /**
         * 设置多车道实体
         *
         * @return
         */
        MultiLaneModel setMultiLaneModel();

        /**
         * 保存双黄线左侧实线点位
         *
         * @param trajectoryPoints
         * @param pyDistance
         */
        void saveSHXLeftPoint(List<TrajectoryPointEntity> trajectoryPoints, float pyDistance);

        /**
         * 保存轨迹点位
         *
         * @param operCode 1:新增 2：修改
         */
        boolean saveTrajectoryPoint(TrajectoryPointEntity trajectoryPoint, int operCode);

        /**
         * 加载轨迹点位表中是否有用未标定的基站采集的点位
         *
         * @return
         */
        boolean loadPointCalibrationStatus(Boolean isBaseCalibration);

        /**
         * 根据东北坐标查询附近点位
         *
         * @param minX
         * @param maxX
         * @param minY
         * @param maxY
         * @return
         */
        HashMap<String, List<TrajectoryPointEntity>> loadNearbyPoint(float minX, float maxX, float minY, float maxY);

        /**
         * 根据经纬度查询附近点位
         *
         * @param minLon
         * @param maxLon
         * @param minLat
         * @param maxLat
         * @return
         */
        HashMap<String, List<TrajectoryPointEntity>> loadNearbyPoint(double minLon, double maxLon, double minLat, double maxLat, boolean flag);

        /**
         * 加载距离x最近点
         *
         * @param x
         * @return
         */
        TrajectoryPointEntity loadMinPoint(float x, boolean isDy);

        /**
         * @param longitude
         * @param isDy
         * @return
         */
        TrajectoryPointEntity loadMinPoint(double longitude, boolean isDy, boolean flag);

    }

    interface View {

    }

}